home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group02b.txt / 000090_icon-group-sender_Thu Oct 24 16:24:22 2002.msg < prev    next >
Internet Message Format  |  2003-01-02  |  1KB

  1. Return-Path: <icon-group-sender>
  2. Received: (from root@localhost)
  3.     by baskerville.CS.Arizona.EDU (8.11.1/8.11.1) id g9ONNaQ17534
  4.     for icon-group-addresses; Thu, 24 Oct 2002 16:23:36 -0700 (MST)
  5. Message-Id: <200210242323.g9ONNaQ17534@baskerville.CS.Arizona.EDU>
  6. Date: Thu, 24 Oct 2002 13:13:16 -0700 (MST)
  7. From: Gregg Townsend <gmt>
  8. To: icon-group
  9. Subject: Re: move_corresponding
  10. Errors-To: icon-group-errors@cs.arizona.edu
  11. Status: RO
  12.  
  13. Here's what I came up with, realizing that Icon will fail gracefully
  14. when the names don't match:
  15.  
  16. #  movecorr(R1, R2) copies values from the fields of record R1 into
  17. #  fields of the same names (if any) in record R2, and returns R2.
  18.  
  19. procedure movecorr(R1, R2)
  20.    local s
  21.    every s := (name(!R1) ? (tab(upto('.') + 1) & tab(0))) do
  22.       R2[s] := R1[s]
  23.    return R2
  24. end
  25.  
  26. ---------------------------------------------------------------------------
  27. Gregg Townsend         Staff Scientist      The University of Arizona
  28. gmt@cs.arizona.edu     Computer Science     Tucson, Arizona, USA
  29.